package com.pz.cloud.framework.workflow.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pz.cloud.framework.business.workflow.entity.TaskNodeField;
import com.pz.cloud.framework.business.workflow.service.ITaskNodeFieldService;
import com.pz.cloud.framework.workflow.mapper.TaskNodeFieldMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 任务节点字段
 * @author mzz
 */
@Transactional(rollbackFor = Exception.class)
@Service
public class TaskNodeFieldServiceImpl extends ServiceImpl<TaskNodeFieldMapper, TaskNodeField> implements ITaskNodeFieldService {
    @Override
    public List<TaskNodeField> findByTaskKey(String taskKey) {
        LambdaQueryWrapper<TaskNodeField> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(TaskNodeField::getTaskKey,taskKey);
        List<TaskNodeField> list = this.list(queryWrapper);
        return list;
    }
    @Override
    public void deleteByTaskKey(String taskKey) {
        LambdaQueryWrapper<TaskNodeField> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(TaskNodeField::getTaskKey,taskKey);
        this.remove(queryWrapper);
    }
}
